package com.kaily.timemanager.activity;

import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.annotation.Nullable;
import android.widget.LinearLayout;

import com.app.common.util.Tools;
import com.app.common.view.slidebar.SideBarLayout;
import com.kaily.timemanager.R;
import com.kaily.timemanager.obj.TaskClass;
import com.kaily.timemanager.obj.TitleInfo;
import com.kaily.timemanager.view.ITaskClassActionListener;
import com.kaily.timemanager.view.TaskClassLayout;

import java.util.ArrayList;
import java.util.List;

import butterknife.InjectView;

/**
 * Created by zhoulikai on 17/2/28.
 */

public class TestActivity extends AppBaseActivity implements ITaskClassActionListener {

    //    SideBarLayout taskAllLayout;
    private TaskClassLayout taskClassLayout;
    List<TaskClass> taskClasses = new ArrayList<>();

    @Override
    public TitleInfo getTitleInfo() {

        return null;
    }

    @Override
    public int initLayoutId() {
        return R.layout.taskclass_layout;
    }

    @Override
    public void initPage() {
        super.initPage();
        int width = Tools.getScreenSize(this)[0];
//        this.taskAllLayout.setPageWidth(SideBarLayout.SLIDER_PAGE_LEFT, width / 3);
//        this.taskAllLayout.setPageWidth(SideBarLayout.SLIDER_PAGE_RIGHT, width);
        taskClassLayout = (TaskClassLayout) this.findViewById(R.id.taskclass_layout);

        for (int i = 0; i < 10; i++) {
            TaskClass taskClass = new TaskClass();
            taskClass.setTaskClassName("张三" + i);
            taskClasses.add(taskClass);
        }
        taskClassLayout.initTaskClasses(taskClasses, this);

    }

    @Override
    public void addTaskClassAction(TaskClass taskClass, TaskClassLayout.TaskClassAdapter taskClassAdapter) {
        taskClasses.add(taskClass);
        taskClassAdapter.notifyDataSetChanged();
    }

    @Override
    public void updateTaskClassAction(TaskClass taskClass, TaskClassLayout.TaskClassAdapter taskClassAdapter) {

    }

    @Override
    public void deleteTaskClassAction(TaskClass taskClass, TaskClassLayout.TaskClassAdapter taskClassAdapter) {

    }
}
